import {
  HTTP
}
  from '../util/http-book.js'

class BookModel extends HTTP{
  getHotList(){
    return this.request({
      url:'/book/hot_list'
  })
  }
  getMyBookCount(){
    return this.request({
      url: '/book/favor/count'
  })
  }
  getDetail(bid) {
    return this.request({
      url: `/book/${bid}/detail`
    })
  }
  getLikeStatus(bid) {
    return this.request({
      url: `/book/${bid}/favor`
    })
  }
  getComments(bid) {
    return this.request({
      url: `/book/${bid}/short_comment`
    })
  }

  postComments(bid,comment) {
    return this.request({
      url: `/book/add/short_comment`,
      method:'POST',
      data:{
          book_id:bid,
          content:comment
      }
    })
  }

  // 搜索书籍
  search(start,q){
    return this.request({
      url:'book/search?sunmmary=1',
      data:{
        q:q,
        start:start
      }
    })
  }
}
export { BookModel }